<?php
	require 'config.php';
	$name = $_POST['name'];

	$query = mysql_query("SELECT commodity_uid,Course_Name,Price,Kind,Amount,Course_Description FROM r_commodity WHERE Course_Name='$name'") or die('SQL 错误！');
	

	$json = '';
	
	while (!!$row = mysql_fetch_array($query, MYSQL_ASSOC)) {
		$json .= json_encode($row).',';
	}

	$json = substr($json, 0, -1);

	echo '['.$json.']';
	mysql_close();
?>
